class Rule{
	constructor(column,values,message,attribute,params,i18n){
		var _message = message?message:i18n.__(this.name())
		var _attribute = attribute?attribute:(i18n.__("attributes")[column]?i18n.__("attributes")[column]:column)
		var _value = values[column]
		this.$check = this.check(column,_value,values,params)
		this.$message = this.message(column,_value,values,_message,_attribute,params)
	}
	name(){
		return 'rule'
	}
	check(column,value,values,params){
		return true
	}
	message(column,value,values,message,attribute,params){
		message = message?message.replace(":attr",attribute === 'undefined'?column:attribute):"未找到对应信息"
		return message
	}
}
module.exports = Rule